<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>融资项目管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">融资项目名称</div>
                    <div class="field">
                        <input name="ruleNm" id="ruleNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>

                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button sq-button-round">清空</span>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null,callback=null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/capAdvRuleInfo/initList.do',
            method: 'get',
            columns: [
                {display: '垫款规则名称', name: 'ruleNm', minWidth: 100, align: 'center', enabledSort: false},
		        //{display: '规则状态  1.开启 0.关闭', name: 'ruleStsCdNm', minWidth: 100, align: 'left', enabledSort: false},
		        {display: '垫款日期类型', name: 'dtTypCdNm', minWidth: 100, align: 'center', enabledSort: false},
		        {display: '垫款方式', name: 'isAllAdv', minWidth: 100, align: 'center', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(rowdata.isAllAdv == '1'){
                            return '全垫';
                        }else{
                            return '非全垫';//rowdata.advPd + '期';
                        }
                    }
                },
                {
                    display: '启用状态', width: 100, align: 'center', enabledSort: false,
                    render: function (rowdata, index, value) {
                        /*if(rowdata.ruleStsCd == '1'){
                            return '<input type="radio" name="ruleStsCd_\''+index+'\'" id="ruleStsCd_\''+index+'\'" checked /><span class="requiredSymbol">开启</span>' + '<input type="radio" name="ruleStsCd_\''+index+'\'" id="ruleStsCd_\''+index+'\'" /><span class="requiredSymbol">关闭</span>';
                        }
                        return  '<input type="radio" name="ruleStsCd_\''+index+'\'" id="ruleStsCd_\''+index+'\'" /><span class="requiredSymbol">开启</span>'+'<input type="radio" name="ruleStsCd_\''+index+'\'" id="ruleStsCd_\''+index+'\'" checked /><span class="requiredSymbol">关闭</span>';*/
                        if(rowdata.ruleStsCd == '1'){
                            return '<a href="javascript:changeRuleStsCd('+rowdata.id+',\''+rowdata.ruleStsCd+'\');" class="link"><span class="requiredSymbol">已开启</span></a>';
                         }
                            return '<a href="javascript:changeRuleStsCd('+rowdata.id+',\''+rowdata.ruleStsCd+'\');" class="link"><span class="requiredSymbol">已关闭</span></a>';
                    }
                }
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: 600,
            height: 400,
            heightDiff: -2,
            //isScroll: false,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });
        
        callback = function () {
            grid.reload();
        };
    });

    function f_select()
    {
        var rows = grid.getCheckedRows();
        return rows;
    }
</script>

</body>
</html>
